﻿<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  xmlns:my="clr-namespace:caedisi.Views.Controls"  x:Class="caedisi.Views.Controls.TransitionRuleControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="600"              
             >
<!--DataContext="{Binding RelativeSource={RelativeSource Self}}"-->

    <Grid x:Name="LayoutRoot" Background="White"  HorizontalAlignment="Stretch"  >
        <Grid Name="GridTransitionRules" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <sdk:Label Grid.Column="0" Name="RuleName" Content="Name" Margin="20,0,0,0" />
            <TextBox Grid.Column="1" Grid.ColumnSpan="4" Text="{Binding Path=Name, Mode=TwoWay, NotifyOnValidationError=True}" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch" />

            <sdk:Label Grid.Row="1"  Grid.Column="0" Name="RuleDescription"  Content="Description" Margin="20,0,0,0"/>
            <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="4" Text="{Binding Path=Description, Mode=TwoWay, NotifyOnValidationError=True}" VerticalAlignment="Stretch"  AcceptsReturn="True" HorizontalAlignment="Stretch"/>
            
            <!--TODO Add functioniality to search in Library-->
            <Button Grid.Column="2" Content="Search" Margin="0,0,0,0" HorizontalAlignment="Center" Visibility="Collapsed"/>

            <sdk:Label Grid.Row="2" Grid.Column="1" Content="Current Neighbourhood Configuration" Margin="0,10,0,0"  HorizontalAlignment="Center" />
            <sdk:Label Grid.Row="2"  Grid.Column="3" Content="Result state"  Margin="0,10,0,0" HorizontalAlignment="Center"  />
            
            <!-- Dynamically Created-->
            <Grid Grid.Row="3" Grid.Column="1" Name="NeighbouringStateConfigurationGrid" HorizontalAlignment="Center"  VerticalAlignment="Center">                
              
            </Grid>
          
            <Image Grid.Row="3" Grid.Column="2"  Source="/caedisi;component/Assets/Images/RightArrow-icon.png" Height="18" VerticalAlignment="Center" />
            <my:BasicCellControl  Grid.Row="3" Grid.Column="3" SelectedCellStateTypeId="{Binding Path=ResultCellStateTypeId, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

        </Grid>
    </Grid>
</UserControl>
